import CryptoJS from './crypto-js.js';
export default{	
	secret:function(string, operation){
		var code = '8416760d1e8f40e427da0b35d4fb74cc';
		code = CryptoJS.MD5(code).toString();
		var iv = CryptoJS.enc.Utf8.parse(code.substring(0,16));
		var key = CryptoJS.enc.Utf8.parse(code.substring(16));
		if(operation){
			return CryptoJS.AES.decrypt(string,key,{iv:iv,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8);
		}
		return CryptoJS.AES.encrypt(string, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7}).toString();
	},
	//MD5签名
	_md5: function(string) {
		return CryptoJS.MD5(string).toString();
	}
}